﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace ORMDemo.Core.Validate
{
    public class ValidateIntVerify : BaseValidateAttribute
    {
        private int[] _item = null;
        public ValidateIntVerify(params int[] item)
        {
            _item = item;
        }
        public override bool Validate(object value)
        {
            return value != null && !string.IsNullOrWhiteSpace(value.ToString())
                && int.TryParse(value.ToString(), out int ivalue) && _item.Contains(ivalue);
        }

    }
}
